package cn.sytton.taffecloud.serivce.auth.controller;

import cn.sytton.taffecloud.serivce.auth.captcha.Captcha;
import cn.sytton.taffecloud.serivce.auth.captcha.CaptchaFactory;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 图形验证码控制层
 *
 * @author skyrock
 */
@RestController
@RequestMapping("/captcha")
public class CaptchaController {

    @Resource
    private CaptchaFactory captchaFactory;

    @GetMapping("/code")
    public Captcha getCaptcha() {
        return captchaFactory.generateCode();
    }
}
